package com.qfedu.mapper;

import com.qfedu.pojo.SysRoleUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SysRoleUserMapper {
    @Select("select * from sys_role_user")
    List<SysRoleUser> selectAll();

    @Select("select * from sys_role_user where userId=#{userId}")
    SysRoleUser selectByUserId(Integer userId);

    @Insert("insert into sys_role_user values(#{userId},#{roleId}) ")
    Integer add(SysRoleUser sysRoleUser);

    @Delete("delete from sys_role_user where userId =#{userId}")
    Integer delete(Integer userId);

    @Update("update sys_role_user set roleId=#{roleId} where userId =#{userId} ")
    Integer update(SysRoleUser sysRoleUser);


}
